Repository navigation
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… range Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
extrapolate(signal, freqRange, order=4)topytta.functions, the extrapolation of a spectrum beyond its valid range ofita_extrapolateof the ITA-Toolbox. OutsidefreqRange = [f1, f2]the spectrum is replaced by IIR models fitted near each end withinvfreqz(#110). The low model is fitted on f1 + (0.01 to 0.2)(f2 - f1) and used below f1, and the high model on f1 + (0.9 to 0.99)(f2 - f1) and used above f2, the bands of the ITA-Toolbox.The ITA-Toolbox fits with MATLAB's
rationalfit(RF Toolbox), which has no SciPy counterpart; the equation error fit ofinvfreqztakes its place. A pure delay is not a low-order model, so it should be removed first (time_shiftof #96); the ITA-Toolbox removes it inside the function. The ITA code was read for its semantics only and nothing was copied.This pull request builds on #110 and shows its commit until #110 is merged.
The test in
tests/test_extrapolate.pytakes a band-pass filter of order 4, replaces its spectrum outside 300 Hz to 3 kHz by noise, and extrapolates with models of order 4: the spectrum comes back outside that range within 3.2e-4 of its peak, which is what the float32 samples ofSignalObjallow.Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of
development(3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com